import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

export type infoType = {

	id?: number,
	supUnityName?: string,
	unityName?: string,
	projectName?: string,
	city?: string,
	contactName?: string,
	contactPhone?: string,
	updatedAt?: string,
  supUnityId: number,
  projectId: number,
  roleNames:object,
}
export type infoTypeList = {
  data: infoType[];
  total: number;
};

const List = '/system/unity/project/v2/projects';
const Url = '/system/unity/project/v2/project';
export const getList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", List, {
    params
  });
};
export const getInfo = (params?: object) => {
  return http.request<commonResult<infoType>>("get", Url, {
    params
  });
};
export const addInfo = (data?: object) => {
  return http.request<commonResult<any>>("post", Url, {
    data
  });
};
export const editInfo = (data?: object) => {
  return http.request<commonResult<any>>("put", Url, {
    data
  });
};
export const deleteInfo = (data?: object) => {
  return http.request<commonResult<any>>("delete", Url, {
    data
  });
};
//获取项目下拉框 
export const projectops = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", "/system/unity/project/v2/project-ops", {
    params
  });
};
//1.9.3 监管告警记录
export const gertalarmList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", "/system/alarm/v2/supervise/alarm-record", {
    params
  });
}
//1.9.4 监管告警记录详情
export const gertalarmDetail = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", "/system/alarm/v2/alarm", {
    params
  });
}
//1.2.17.1监管设备列表    
export const gedevicesList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", "/system/device/v2/sup-devices", {
    params
  });
}
//删除监管设备
export const gedevicesDelete = (data?: object) => {
  return http.request<commonResult<infoTypeList>>("delete", "/system/device/v2/sup-devices", {
    data
  });
}
